home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Source / HippoDraw / hippo / hippoplotX11.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-28  |  4.3 KB  |  165 lines

  1. /*
  2.  * hippoplotX11.h -  routines for producing pure X displays.
  3.  *
  4.  *
  5.  * Author          : Tony Johnson
  6.  * Created On      : 8 Feb 1992
  7.  * Last Modified By: Tony Johnson
  8.  * Last Modified On: 8 Feb 1992
  9.  * Update Count    : 
  10.  * Status          : Release 1
  11.  *
  12.  * Copyright (C)  1991  The Board of Trustees of The Leland Stanford
  13.  * Junior University.  All Rights Reserved.
  14.  *
  15.  * $Id: hippoplotX11.h,v 1.2 1992/04/10 00:14:01 rensing Rel $
  16.  */
  17.  
  18.  
  19.  
  20. #ifndef _hippoplotX11_h_
  21. #define _hippoplotX11_h_
  22.  
  23. #define __TYPES_LOADED 1
  24. #include <X11/Xlib.h>
  25. #include "hippo.h"    /* For structures and enums... */
  26.  
  27. #define HIPPOPLOTX11_H_RCSID "$Id: hippoplotX11.h,v 1.2 1992/04/10 00:14:01 rensing Rel $"
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32.  
  33.  
  34. /*
  35.  * initPlot - specify the X display and drawable to be used
  36.  * for drawing.  This sets global values that are used by the other routines,
  37.  * so it should be called whenever the information is changed (h_plot).
  38.  */ 
  39. void initPlot_X11(Display *disp, Screen *scrn, Drawable drawable, GC gc);
  40.  
  41. /*
  42.  * setHistoCoords - specify the inner rectangle (margin) in device coords
  43.  * (points), and the inner rectangle again in user coords. This sets global
  44.  * values that are used by the other routines, so it should be called
  45.  * whenever any rectangle specification is changed.  Note that the outer
  46.  * rectangle (drawRect) is determined from the Canvas object, so we don't
  47.  * pass that.
  48.  */
  49. void setHistoCoords_X11(rectangle* draw, rectangle* margin, rectangle* data);
  50.  
  51. /*
  52.  * Place text at a given location in device coords. X alignment is
  53.  * specified as 'L', 'R', or 'C' (or lower case), meaning that the
  54.  * left, right, or center of the text is positioned at the xy
  55.  * location.  Similarly Y alignment is given as 'B', 'C', or 'T', for
  56.  * bottom, center or top.  Rotation is then performed, given in
  57.  * degrees anti-clockwise.  The variable 'fontSize' is the size in
  58.  * 'points', which is currently ignored.
  59.  */
  60. void drawText_X11(char *message,
  61.                 float x,
  62.                 float y,
  63.                 float fontHeight,
  64.                 float angle,
  65.                 char xalign,
  66.                 char yalign);
  67.  
  68. /*
  69.  * plot "x10^mag" at specified location
  70.  */
  71. void drawMag_X11(float x, float y,
  72.                int mag,
  73.            float fontsize);
  74.  
  75. /*
  76.  * draw ticks and labels along X axis
  77.  */
  78. void drawXTicks_X11(float* x,
  79.                   int nt,
  80.                   float tickwidth,
  81.               int side);
  82.  
  83. /*
  84.  * draw ticks and labels along Y axis
  85.  */
  86. void drawYTicks_X11(float* y,
  87.                   int nt,
  88.                   float tickwidth,
  89.           int side);
  90. /*
  91.  * draw a rectangle using the supplied device coordinates (points).
  92.  */
  93. void drawRect_X11(float x, float y,
  94.                 float width, float height);
  95.  
  96. /*
  97.  * draw a filled rectangle using the supplied device coordinates (points).
  98.  * The fill is determined by "grey" (0-1).
  99.  */
  100. void drawFilledRect_X11(float x, float y,
  101.                       float width, float height,
  102.                       float grey);
  103.  
  104. /*
  105.  * draw a shaded rectangle in data coordinates, using a 60% grey.
  106.  */
  107. void shade_X11(float xlow, float xhigh,
  108.          float ylow, float yhigh );
  109.  
  110. /*
  111.  * Draw lines between coordinates
  112.  */
  113. void drawLine_X11(float *xy, int nxy,
  114.         linestyle_t ls);
  115.  
  116. /*
  117.  * Draw a series of points, using the symbol specified
  118.  */
  119. void drawPoints_X11(float xy[],
  120.                   int nxy,
  121.                   int symbol,
  122.                   float symbolsize);
  123.  
  124. /*
  125.  * Draw horizontal error bars.  We use only the y part of the
  126.  * coordinates, plus the x-low and x-high pairs.
  127.  */
  128. void drawXError_X11(float xy[],
  129.                   float errs[],
  130.                   int npts);
  131.  
  132. /*
  133.  * Draw vertical error bars.  We use only the x part of the
  134.  * coordinates, plus the y-low and y-high pairs.
  135.  */
  136. void drawYError_X11(float xy[],
  137.                   float errs[],
  138.                   int npts);
  139.  
  140. /*
  141.  * greyscale/color 2D plot
  142.  */
  143. void drawColor2D_X11(int nXBins,
  144.                    int nYBins,
  145.                    float minBin,
  146.                    float maxBin,
  147.                    float bins[],
  148.                    int   fullColor);
  149.  
  150. /*
  151.  * 3D histogram (lego plot).  
  152.  */
  153. void drawLego2D_X11(int nXBins,
  154.                   int nYBins,
  155.                   float minBin,
  156.                   float maxBin,
  157.                   float bins[]);
  158.                   
  159. #ifdef __cplusplus
  160. }
  161. #endif
  162.  
  163. #endif                /* ifndef _hippoplotX11_h_ */
  164.  
  165.